home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Animation How-To
/
Animation How-to CD.iso
/
PLY
/
CHAPTER2
/
ROCKET
/
ROCKET1.BAS
< prev
next >
Wrap
BASIC Source File
|
1994-01-01
|
2KB
|
63 lines
' ROCKET1.BAS
' Polyray Rocket Launch Animation Simulation
SCREEN 12
WINDOW (-32, -24)-(32, 24)
'The tunnel - alternating tall and square boxes
FOR x = -15 TO 16
IF x MOD 2 = 0 THEN
LINE (x - .5, -2)-(x + .5, 2), 15, B
ELSE
LINE (x - .5, -.5)-(x + .5, .5), 15, B
END IF
NEXT x
' some constants - they stay fixed but follow the
' syntax of the changing variables
cameray = .2 ' camera y-offset
lookaty = 0 ' look at y-offset
rockety = 0 ' rocket y-offset
ocy = cameray ' old camera y-offset
oly = lookaty ' old look at y-offest
ory = rockety ' old rocket y-offset
totalframes = 200
FOR frame = 0 TO totalframes
norm = frame / totalframes ' frame normal - 0 to 1
cameraz = -15 + 30 * norm ' camera goes from -15 to 15
lookatz = -10 + 30 * norm ' look at leads the camera by 5
rocketz = -30 + 60 * norm ' rocket goes from -30 to 30
'undraw
FOR section = -4 TO 4
LINE (orz - .4 + section, ory - .05)-(orz + .4 + section, ory + .05), 0, BF
NEXT section
CIRCLE (ocz, ocy), .2, 0
CIRCLE (olz, oly), .2, 0
'draw
FOR section = -4 TO 4
LINE (rocketz - .4 + section, rockety - .05)-(rocketz + .4 + section, rockety + .05), 4, BF
NEXT section
CIRCLE (cameraz, cameray), .2, 4
CIRCLE (lookatz, lookaty), .2, 2
'save
orz = rocketz
ocz = cameraz
olz = lookatz
' a pause loop to slow it down for viewing, use as needed
FOR w = 1 TO 1000: NEXT w
NEXT frame